<?php
namespace app\forum\controller;
use app\forum\controller\SiteController;
/**
 * 新帖列表
 */
class NewsController extends SiteController {

    /**
     * 主页
     */
    public function index(){
        //获取置顶
        $where = array();
        $where['A.type_top'] = 2;
        $topList = target('forum/Thread')->loadList($where);
        //获取新帖分页
        $where = array();
        $where['A.status'] = 1;
        $where['A.type_top'] = 0;
        $pageList = target('Thread')->page(20)->loadList($where,10,'A.post_time desc,A.thread_id desc');
        $this->pager = target('Thread')->pager;
        $page = $this->getPageShow($pageMaps);
        $this->assign('pageList', $pageList);
        $this->assign('page', $page);
        $this->assign('topList', $topList);
        $this->siteDisplay('index');
    }
}